package com.ruoyi.system.domain;

import com.ruoyi.common.annotation.Excels;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.beans.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * 订单对象 t_b_order
 * 
 * @author pspyy
 * @date 2022-03-09
 */
public class TBOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderNum;

    /** 客户id */
    private Long customerId;
    @Excels({
        @Excel(name = "客户名称", targetAttr = "customerName", type = Excel.Type.EXPORT),
    })
    private TBCustomer customer;
    /** 销售时间 */
    @Excel(name = "销售时间")
    private String sellTime;

    /** 订单金额 */
    @Excel(name = "订单金额")
    private Long orderMoney;

    /** 付款方式;0:全款；1:分期付款 */
    @Excel(name = "付款方式",readConverterExp = "0=全款,1=分期付款")
    private String payMethod;

    /** 付款时间 */
    @Excel(name = "付款时间")
    private String payTime;

    /** 设备状态;0:入库；1:设备售出 */
    @Excel(name = "设备状态",readConverterExp = "0=入库,1=设备售出")
    private String deviceState;

    /** 首付款 */
    @Excel(name = "首付款")
    private Long downPayment;

    @Excel(name = "订单设备数量")
    private Long orderDeviceNum;

    @Excel(name = "订单分期情况")
    private String orderSpreadNum;

    private List<TBOrderSpread> orderSpreadList = new ArrayList<>();
    private List<Long> deviceIds = new ArrayList<>();


    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setOrderNum(String orderNum) 
    {
        this.orderNum = orderNum;
    }

    public String getOrderNum() 
    {
        return orderNum;
    }
    public void setCustomerId(Long customerId) 
    {
        this.customerId = customerId;
    }

    public Long getCustomerId() 
    {
        return customerId;
    }
    public void setSellTime(String sellTime) 
    {
        this.sellTime = sellTime;
    }

    public String getSellTime() 
    {
        return sellTime;
    }
    public void setOrderMoney(Long orderMoney) 
    {
        this.orderMoney = orderMoney;
    }

    public Long getOrderMoney() 
    {
        return orderMoney;
    }
    public void setPayMethod(String payMethod) 
    {
        this.payMethod = payMethod;
    }

    public String getPayMethod() 
    {
        return payMethod;
    }
    public void setPayTime(String payTime) 
    {
        this.payTime = payTime;
    }

    public String getPayTime() 
    {
        return payTime;
    }
    public void setDeviceState(String deviceState) 
    {
        this.deviceState = deviceState;
    }

    public String getDeviceState() 
    {
        return deviceState;
    }
    public void setDownPayment(Long downPayment) 
    {
        this.downPayment = downPayment;
    }

    public Long getDownPayment() 
    {
        return downPayment;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderNum", getOrderNum())
            .append("customerId", getCustomerId())
            .append("sellTime", getSellTime())
            .append("orderMoney", getOrderMoney())
            .append("payMethod", getPayMethod())
            .append("payTime", getPayTime())
            .append("deviceState", getDeviceState())
            .append("downPayment", getDownPayment())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("orderSpreadList", getOrderSpreadList())
            .append("customer", getCustomer())
            .toString();
    }

    public List<TBOrderSpread> getOrderSpreadList() {
        return orderSpreadList;
    }

    public void setOrderSpreadList(List<TBOrderSpread> orderSpreadList) {
        this.orderSpreadList = orderSpreadList;
    }

    public TBCustomer getCustomer() {
        return customer;
    }

    public void setCustomer(TBCustomer customer) {
        this.customer = customer;
    }

    public List<Long> getDeviceIds() {
        return deviceIds;
    }

    public void setDeviceIds(List<Long> deviceIds) {
        this.deviceIds = deviceIds;
    }

    @Transient
    public Long getOrderDeviceNum() {
        return orderDeviceNum;
    }

    public void setOrderDeviceNum(Long orderDeviceNum) {
        this.orderDeviceNum = orderDeviceNum;
    }

    @Transient
    public String getOrderSpreadNum() {
        return orderSpreadNum;
    }

    public void setOrderSpreadNum(String orderSpreadNum) {
        this.orderSpreadNum = orderSpreadNum;
    }
}
